<?php 
include'connecsi.php';
$kunci1=$_POST[kunci1];
$id=$_GET[id];
$bilang=$_GET[bilang];
?>
<html>
<head>
<title>Kelola Data Pasien</title>
<link rel="stylesheet" href="clccss.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
	function MM_jumpMenu(targ,selObj,restore){ 
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}
</script>
<style type="text/css">
<!--
.style3 {color: #000000; font-weight: bold; }
-->
</style>
</head>
<body>
<table width="100%" align="center" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
<tr><td>
  <table width="100%"  border="0" cellspacing="1" cellpadding="1" bgcolor="#ffffff">
    <tr>
      <td align="left"><p class="style3">&nbsp;</p>
        </td>
    </tr>
    <tr>
      <td><table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td><table width="41%"  border="0" cellspacing="1" cellpadding="1">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr align="left">
        <td width="35%"><span class="style3">Kode Pasien </span></td>
        <td width="65%" align="left">
		  <select name="kunci1" onChange="MM_jumpMenu('parent',this,1)">
		  <option value="home.php?ling=kpas">--Pilih Kode--</option>
		  <?php 
		  $bu = mysql_query("select ID_PASIEN from db_pasien");
		  while($ha=mysql_fetch_array($bu)) {
			echo"<option value='home.php?ling=kpas&serch=tinjau&kdpasien=$ha[ID_PASIEN]'>$ha[ID_PASIEN]</option>";
		  } ?>	
		  </select>
		</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table></td></tr>
</table>
</td></tr>
</table>
<?php
if($_GET[aksi]=="hapus")
		{
			$dihapus=mysql_query("delete from db_pasien where ID_PASIEN='$bilang' ");
			if($dihapus)
			{ echo "<script>alert('Data Sudah Terhapus')</script>";echo"<meta http-equiv=refresh content=0;URL='home.php?ling=kpas'>"; }
		}	
		?>
<?php
if($_GET[serch]=="tinjau")
{
	echo"<a href='index.php?ling=kpas&serch=tinjau&kdpasien=$ha[ID_PASIEN]'></a>";
	$buka=mysql_query("select * from db_pasien where ID_PASIEN='$_GET[kdpasien]'");
	$hasil=mysql_fetch_array($buka);
		if($hasil)
		{
?>
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#000000">
  <tr bgcolor="#D7D5D6">
     <td width="19%" align="center"><font color="d7d5d6">a</font><font color="#FFFFFF">ID</font><font color="d7d5d6">a</font></td>
	<td width="15%" align="center"><font color="d7d5d6">aaa</font><font color="#FFFFFF">NAMA</font><font color="d7d5d6">aaa</font></td>
	<td width="15%" align="center"><font color="d7d5d6">a</font><font color="#FFFFFF">TGL DAFTAR</font><font color="d7d5d6">a</font></td>
    <td width="15%" align="center"><font color="d7d5d6">aaa</font><font color="#FFFFFF">NO.TLP</font><font color="d7d5d6">aaa</font></td>
  <td width="15%" align="center"><font color="d7d5d6">aaaa</font><font color="#FFFFFF">AKSI</font><font color="d7d5d6">aaaa</font></td>
  </tr>
  <? do { ?>
  <tr>
    <td align="center"><? echo"$hasil[ID_PASIEN]"; ?></td>
    <td align="center"><? echo"$hasil[NAMA_PASIEN]"; ?></td>
    <td align="center"><? echo"$hasil[TGL_DAFTAR]"; ?></td>
    <td align="center"><? echo"$hasil[TLP_PASIEN]"; ?></td>
	<td><center>
      <font><a href="detail_pasien.php?kiriman=<? echo"$hasil[ID_PASIEN]";?>"><img src="images/view.png" width="16" height="16" title="View"/></a> | <a href="edit_pasien.php?kiriman=<? echo"$hasil[ID_PASIEN]";?>"><img src="images/Edit.png" title="Edit"/></a> | <a href="home.php?ling=kpas&aksi=hapus&bilang=<? echo"$hasil[ID_PASIEN]";?>" onClick="return confirm('Apakah Data Pasien Akan diHapus ?')"><img src="images/delete.png" width="16" height="16" title="Delete"/></a></font>
    </center></td>
  <? } while($hasil=mysql_fetch_array($buka)) ?>
</table><br>
<? 
	}
	else
	{ echo"<font color=red>Maaf Tidak Ada Datanya</font>";echo"<meta http-equiv=refresh content=3;URL='home.php?ling=kpas'>"; }}?>
</body>
</html>